package nc.tb.report.plugin;
import java.util.ArrayList;

import nc.tb.app.CommonPlan;
import nc.tb.ctl.PlanCTL;
import nc.tb.cube.SheetDef;
import nc.tb.cube.cell.DataCell;
import nc.tb.pub.NtbEnv;
import nc.tb.pub.util.NtbLogger;

public class SimPlan  {
	public SimPlan() {
		
		init();
	}
	private CommonPlan m_plan = null;

	private void init() {
		try {
			NtbEnv.loadInvokeProxy();
			m_plan = PlanCTL.getPlanByPK("0001K11000000000038K");
//			m_plan = PlanCTL.getPlanByPK("0001K11000000000336W");
			
		} catch (Exception e) {
			NtbLogger.error(e);
		}
	}

	public ArrayList<DataCell> getDataCells() {
		ArrayList<DataCell> a = new ArrayList<DataCell>();
		if (m_plan != null) {
			return m_plan.getDataCellsList();
		} else {
			for (int i = 0; i < 50; i++) {
				DataCell dc = new DataCell();
				try {
					dc.setValue(300 + i);
				} catch (Exception ex) {
					NtbLogger.error(ex);
				}
				a.add(dc);
			}
		}
		return a;
	}
	public SheetDef getSheetDef(){
		return m_plan.getSheetDef();
	}
}
